DependencyTracker: only handle STORE_FAST for the GETTING_IMPORT status#6058
Merged
adhami3310 merged 1 commit intomainfrom Dec 19, 2025
Merged
DependencyTracker: only handle STORE_FAST for the GETTING_IMPORT status#6058adhami3310 merged 1 commit intomainfrom
adhami3310 merged 1 commit intomainfrom
Conversation
STORE_FAST handling is not generally correct outside of the specific case of dealing with imports. So avoid resetting the stack or other issues when we're not importing.
CodSpeed Performance ReportMerging #6058 will not alter performanceComparing Summary
|
Contributor
Greptile SummaryFixes incorrect
The fix addresses a bug where any Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Tracker as DependencyTracker
participant Bytecode as Bytecode Instructions
participant Status as scan_status
participant Locals as tracked_locals
Note over Tracker,Locals: Processing Import Statement
Bytecode->>Tracker: IMPORT_NAME instruction
Tracker->>Status: Set to GETTING_IMPORT
Tracker->>Locals: Add module to tracked_locals
Tracker->>Tracker: Set top_of_stack = module name
Bytecode->>Tracker: STORE_FAST instruction
Tracker->>Status: Check scan_status == GETTING_IMPORT?
Status-->>Tracker: Yes
Tracker->>Locals: Pop and reassign with alias
Tracker->>Tracker: Reset top_of_stack = None
Note over Tracker: BUG: scan_status not reset to SCANNING
Note over Tracker,Locals: Processing Nested Function (After Fix)
Bytecode->>Tracker: MAKE_FUNCTION instruction
Bytecode->>Tracker: STORE_FAST instruction (for nested func)
Tracker->>Status: Check scan_status == GETTING_IMPORT?
Status-->>Tracker: No (if properly reset)
Note over Tracker: STORE_FAST skipped - avoids incorrect handling
|
Contributor
There was a problem hiding this comment.
Additional Comments (1)
-
reflex/vars/dep_tracking.py, line 477-485 (link)logic:
scan_statusshould be reset toScanStatus.SCANNINGafter handling theSTORE_FAST, similar to the pattern in_eval_get_stateat line 309.
2 files reviewed, 1 comment
adhami3310
approved these changes
Dec 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
STORE_FAST handling is not generally correct outside of the specific case of dealing with imports. So avoid resetting the stack or other issues when we're not importing.